#!/bin/bash
num=$(shuf -i 1-100 -n 1)
echo $num

while true
do

printf "请输入一个1-100的数字:"
read num1
if [[ $num1 -eq $num ]];then
    echo "恭喜猜对了,是否继续游戏(y/n)"
    read go
        if [[ $go = "y" ]] || [[ $go = "Y" ]];then
        num=$(( RANDOM % 100 +1))
        echo $num
            continue
        else
            break
        fi
elif [[ $num1 -lt $num ]];then
echo "猜大了"
else
echo "猜小了"

fi


done